<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="../node_modules/@vue/runtime-dom/dist/runtime-dom.global.js"></script>

  <!-- <script src="https://cdn.bootcdn.net/ajax/libs/vue/3.2.0-beta.6/vue.global.js"></script> -->
</head>
<body>
  <div id="app"></div>
  <script>

    const {
      createApp,
      h,
      ref,
      onBeforeMount,
      onMounted,
      onBeforeUpdate,
      onUpdated,
      getCurrentInstace
    } = VueRuntimeDOM;

    let App = {
      setup(props, context) {
        const name = ref(props.name);
        const instance = getCurrentInstace();
        console.log('instace', instance)

        onBeforeMount(() => {
          console.log('onBeforeMount-1');
        });
        onBeforeMount(() => {
          console.log('onBeforeMount-2');
        });
        onMounted(() => {
          console.log('onMounted');
        });
        onBeforeUpdate(() => {
          console.log('onBeforeUpdate');
        });
        onUpdated(() => {
          console.log('onUpdated');
        });
        
        setTimeout(()=> {
          name.value = "jerry"
        }, 1000);

        return () => {
          return h('div', {}, name.value)
        }
      }
    }

    const app = createApp(App, {
      name: 'tom',
      age: 12
    })
    app.mount('#app');

  </script>
</body>
</html>